package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zzyl.common.core.controller.BaseController;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@Api(tags = "服务项目管理")
@RestController
@RequestMapping("/member/orders")
public class MemberOrdersController extends BaseController{
   @Autowired
   private INursingProjectService nursingProjectService;


    /**
     * 分页查询服务项目列表
     */

    @GetMapping("/project/page")
    public TableDataInfo<NursingProject>list(@ApiParam("护理项目查询条件") NursingProject nursingProject)
    {
        startPage();
        TableDataInfo<NursingProject> list = nursingProjectService.findAll(nursingProject);
        return list;
    }

    /**
     * 根据id查询服务项目信息
     */
  @GetMapping("/project/{id}")
    public R<NursingProject> getInfo(@ApiParam("护理项目ID") @PathVariable("id") Long id)
    {
        NursingProject nursingProject = nursingProjectService.findById(id);
        return R.ok(nursingProject);
    }
}

